package fun.tan90.device.main;

import org.noear.dami.DamiConfig;
import org.noear.dami.bus.impl.RoutingPath;
import org.noear.dami.bus.impl.TopicRouterPatterned;
import org.noear.solon.Solon;
import org.noear.solon.annotation.SolonMain;
import org.noear.solon.core.event.*;

@SolonMain
public class App {
    public static void main(String[] args) {
        DamiConfig.configure(new TopicRouterPatterned<>(RoutingPath::new));
        Solon.start(App.class, args, app -> {
            app.enableSessionState(false).enableStaticfiles(false);
            app.onEvent(AppInitEndEvent.class, e -> {
                System.out.println("app init end");
            }).onEvent(AppPluginLoadEndEvent.class, e -> {
                System.out.println("app plugin load end");
            }).onEvent(AppBeanLoadEndEvent.class, e -> {
                System.out.println("app bean load end");
            }).onEvent(AppLoadEndEvent.class, e -> {
                System.out.println("app load end");
            }).onEvent(AppPrestopEndEvent.class, e -> {
                System.out.println("app pre stop end");
            }).onEvent(AppStopEndEvent.class, e -> {
                System.out.println("app stop end");
            });
        });
    }
}